import { newRequest as azureRequest } from '@/utils/newRequest'

//  获取每一个格子中的详情
export function getProductGridList(params) {
  return azureRequest({
    url: '/api/Doing/GetProductGridList',
    method: 'get',
    params
  })
}

//  清空工厂扫描的格子
export function cleanProductPhotoGrid(params) {
  return azureRequest({
    url: '/api/Doing/CleanProductPhotoGrid',
    method: 'post',
    params
  })
}

//  工厂扫描的格子
export function ScanProductGridPhoto(data) {
  return azureRequest({
    url: '/api/Doing/ScanProductGridPhoto',
    method: 'post',
    data,
  })
}

// 获取全部的格子,初始化接口
export function getProductGridAutoList(params) {
  return azureRequest({
    url: '/api/Doing/GetProductGridAutoList',
    method: 'get',
    params
  })
}

//  包装发货
export function Shipping(params) {
  return azureRequest({
    url: '/api/Shipping/Scan',
    method: 'post',
    params, data: params
  })
}

//   获取未完成的订单列表
export function GetUnCompleteOrder(params) {
  return azureRequest({
    url: '/api/Shipping/GetUnCompleteOrder',
    method: 'post',
    params
  })
}

//  陆运产品发货新增包裹
export function AddPackageBag(params) {
  return azureRequest({
    url: '/api/Shipping/AddPackageBag',
    method: 'post',
    params
  })
}

//  /api/Shipping/DeleteShippingBag
export function DeleteShippingBag({ shippingBagCode }) {
  return azureRequest({
    url: '/api/Shipping/DeleteShippingBag',
    method: 'post',
    params:{shippingBagCode}
  })
}

//  GetShippingBag
export function GetShippingBag(params) {
  return azureRequest({
    url: '/api/Shipping/GetShippingBag',
    method: 'post',
    params
  })
}

//  删除整个批次以及明细  /api/Shipping/DeleteShippingRecord
export function DeleteShippingRecord(params) {
  return azureRequest({
    url: '/api/Shipping/DeleteShippingRecord',
    method: 'post',
    params: Object.assign(params, { force: 1 })
  })
}

//  删除包裹中的产品
export function DeleteBagDetail(params) {
  return azureRequest({
    url: '/api/Shipping/DeleteBagDetail',
    method: 'post',
    params
  })
}

/**
 * 航空发货(单面直出)    将直出的产品打印快递单
 * @deprecated
 * @param params
 * @return {AxiosPromise}
 * @constructor
 */
export function ShippingAviation(params) {
  return azureRequest({
    url: '/api/Shipping/ShippingAviation',
    method: 'post',
    params
  })
}

//  new  航空发货(单面直出)    将直出的产品打印快递单
export function ShippingAutoComputeWeight(params) {
  return azureRequest({
    url: '/api/Shipping/ShippingAutoComputeWeight',
    method: 'post',
    params
  })
}

//   均摊接口
export function AveragePackageBagDetail(params) {
  return azureRequest({
    url: '/api/Shipping/AveragePackageBagDetail',
    method: 'post',
    params
  })
}

//  合并包裹 将一个包裹中的内容全部转移到另一个包裹中，并删除该包裹
export function ChangePackageBagDetail(params) {
  return azureRequest({
    url: '/api/Shipping/ChangePackageBagDetail',
    method: 'post',
    params
  })
}

//   陆运产品发货一个包裹一个包裹发货
/**
 * @deprecated
 * @param params
 * @return {AxiosPromise}
 * @constructor
 */
export function Shippingland(params) {
  return azureRequest({
    url: '/api/Shipping/Shippingland',
    method: 'post',
    params
  })
}

//  new  陆运产品发货一个包裹一个包裹发货
export function ShippingNeedWeight(params) {
  return azureRequest({
    url: '/api/Shipping/ShippingNeedWeight',
    method: 'post',
    params
  })
}

//  陆运发货并打印快递单,批量
export function ShippingBagsForLand(data) {
  return azureRequest({
    url: '/api/Shipping/ShippingBagsForLand',
    method: 'post',
    data
  })
}



//  ScanProductGridEnd
export function ScanProductGridEnd(data) {
  return azureRequest({
    url: '/api/Doing/ScanProductGridEnd',
    method: 'post',
    data
  })
}

//  http://localhost:53125/api/Shipping/GetShippingRecord
export function GetShippingRecord(params) {
  return azureRequest({
    url: '/api/Shipping/GetShippingRecord',
    method: 'post',
    params
  })
}
